package ru.slovoslovo.tzolkin;

import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

public class DaylyKinFragment extends Fragment {

    private void init(View v){
        if (v != null){
            ImageView imageKin = (ImageView) v.findViewById(R.id.imageKin);
            TextView textKin = (TextView) v.findViewById(R.id.textDaylyKinTitle);
            TextView textKinNumber = (TextView) v.findViewById(R.id.textDaylyKinNumberValue);
            TextView textKinAliases = (TextView) v.findViewById(R.id.textDaylyKinAliases);
            
            imageKin.setImageResource(R.drawable.kin_04_kan);
            GradientDrawable background = (GradientDrawable) imageKin.getBackground();
            background.setColor(getResources().getColor(R.color.kin_green));

            textKin.setText("Kan");
            textKinNumber.setText("164");
            textKinAliases.setText("Дракон" +  System.getProperty("line.separator") + "Водяная лилия");
        }
    }
    
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.activity_dayly_kin, null);
        
        init(view);
        
//        Button button = (Button) v.findViewById(R.id.button);
//        button.setOnClickListener(new OnClickListener() {
//            public void onClick(View v) {
//                //Log.d(LOG_TAG, "Button click in Fragment2");
//            }
//        });

        return view;
    }

    @Override
    public void onStart() {
        super.onStart();
    }
}
